<?php $homepage=false;
if (is_home()) {
	if (get_option('glow_duplicate') == 'false') {
		$args=array(
		   'showposts'=>get_option('glow_homepage_posts'),
		   'post__not_in' => $ids,
		   'paged'=>$paged,
		   'category__in' => get_option('glow_exlcats_recent'),
		);
	} else {
		$args=array(
		   'showposts'=>get_option('glow_homepage_posts'),
		   'paged'=>$paged,
		   'category__in' => get_option('glow_exlcats_recent'),
		);
	};
	$homepage=true;
	query_posts($args);
} else {
	if (is_archive()) $post_number = get_option('glow_archivenum_posts');
	if (is_search()) $post_number = get_option('glow_searchnum_posts');
	if (is_tag()) $post_number = get_option('glow_tagnum_posts');
	if (is_category()) $post_number = get_option('glow_catnum_posts');
	global $query_string; query_posts($query_string . "&showposts=$post_number&paged=$paged"); 
}

if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
<?php if (($thumb == '') && ($glow_grab_image == 'on')) $thumb = catch_that_image(); ?>
		<div class="post blogstyle<?php if (!($homepage)) echo(" indexpage"); ?>">
			<div class="new-post">
				<?php if (get_option('glow_postinfo1_show') == 'on') include(TEMPLATEPATH . '/includes/postinfo.php'); ?>
				<h2><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php truncate_title(50); ?></a></h2>
				<a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&amp;h=156&amp;w=156&amp;zc=1" alt="<?php echo(the_title()); ?>" class="thumbnail alignleft" /></a>
				<p><?php the_content(""); ?></p>
				<a href="<?php the_permalink() ?>" class="readmore"><span>Read More</span></a>
				<div class="clear"></div>
			</div> <!-- end new-post -->	
		</div> <!-- end post -->	
<?php endwhile; ?>

<div class="clear"></div>
	<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } 
	else { ?>
	<p class="pagination">
		<?php next_posts_link('&laquo; Previous Entries') ?>
		<?php previous_posts_link('Next Entries &raquo;') ?>
	</p>
	<?php } ?>
<?php else : ?>
	<?php include(TEMPLATEPATH . '/includes/no-results.php'); ?>
<?php endif; wp_reset_query(); ?>